package com.yonglian.management.domain;

import static com.yonglian.management.domain.AssertUtils.zonedDataTimeSameInstant;
import static org.assertj.core.api.Assertions.assertThat;

public class ActivityPlanAsserts {

    /**
     * Asserts that the entity has all properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertActivityPlanAllPropertiesEquals(ActivityPlan expected, ActivityPlan actual) {
        assertActivityPlanAutoGeneratedPropertiesEquals(expected, actual);
        assertActivityPlanAllUpdatablePropertiesEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all updatable properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertActivityPlanAllUpdatablePropertiesEquals(ActivityPlan expected, ActivityPlan actual) {
        assertActivityPlanUpdatableFieldsEquals(expected, actual);
        assertActivityPlanUpdatableRelationshipsEquals(expected, actual);
    }

    /**
     * Asserts that the entity has all the auto generated properties (fields/relationships) set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertActivityPlanAutoGeneratedPropertiesEquals(ActivityPlan expected, ActivityPlan actual) {
        assertThat(expected)
            .as("Verify ActivityPlan auto generated properties")
            .satisfies(e -> assertThat(e.getId()).as("check id").isEqualTo(actual.getId()));
    }

    /**
     * Asserts that the entity has all the updatable fields set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertActivityPlanUpdatableFieldsEquals(ActivityPlan expected, ActivityPlan actual) {
        assertThat(expected)
            .as("Verify ActivityPlan relevant properties")
            .satisfies(e -> assertThat(e.getPlanName()).as("check planName").isEqualTo(actual.getPlanName()))
            .satisfies(
                e ->
                    assertThat(e.getCreateTime())
                        .as("check createTime")
                        .usingComparator(zonedDataTimeSameInstant)
                        .isEqualTo(actual.getCreateTime())
            );
    }

    /**
     * Asserts that the entity has all the updatable relationships set.
     *
     * @param expected the expected entity
     * @param actual the actual entity
     */
    public static void assertActivityPlanUpdatableRelationshipsEquals(ActivityPlan expected, ActivityPlan actual) {}
}
